package com.hqyj.controller;


import com.hqyj.pojo.Tables;
import com.hqyj.service.TablesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

/**
 * <p>
 * 桌位表 前端控制器
 * </p>
 *
 * @author rock
 * @since 2021-10-22
 */
@RestController
@RequestMapping("/tables")
public class TablesController {
    @Autowired
    TablesService tablesService;

    //加载表格数据
    @RequestMapping("/tablesList")
    public HashMap<String,Object> listPage(Tables tables){
        return tablesService.select(tables);
    }
    //增加
    @RequestMapping("/add")
    public HashMap<String,Object> add(Tables tables){
        return tablesService.add(tables);
    }
    //修改
    @RequestMapping("/update")
    public HashMap<String,Object>  update(Tables tables){
        return tablesService.update(tables);
    }

    //删除
    @RequestMapping("/del")
    public HashMap<String,Object> del(Integer id){
        return tablesService.del(id);
    }

    //顾客预定显示
    @RequestMapping("/tList")
    public HashMap<String,Object> tList(Tables tables){
        return tablesService.tList(tables);
    }
}

